<div class="widget blue">
    <div class="widget-title">
        <h4><i class="icon-envelope"></i><?php echo Yii::t('AweCrud.app', 'Enviar') ?> <?php echo Mail::label(2) ?></h4>
    </div>
    <div class="widget-body">
        <div class="row-fluid">
            <?php
            $flashMessages = Yii::app()->user->getFlashes();
            if ($flashMessages) {
                foreach ($flashMessages as $key => $message) {
                    echo '<div class="alert alert-' . $key . '">';
                    echo $message;
                    echo '</div>';
                }
            }
            ?>
        </div>
        <div class="row-fluid">

            <?php
            $form = $this->beginWidget('ext.AweCrud.components.AweActiveForm', array(
                'type' => 'horizontal',
                'id' => 'seleccion-form',
                'action' => Yii::app()->baseUrl . '/index.php/mail/mail/enviar',
                'enableAjaxValidation' => false,
                'clientOptions' => array('validateOnSubmit' => true, 'validateOnChange' => false,),
                'enableClientValidation' => true,
            ));
            ?>

            <?php
            echo $form->select2Row($model, 'contactos', array(
                'data' => CHtml::listData(Contacto::model()->findAll(), 'id', 'nombre'),
                'class' => 'span12',
                'multiple' => 'multiple',
                'options' => array(
                    'tokenSeparators' => array(','),
                )
            ));



            echo $form->textFieldRow(
                    $model, 'asunto', array('class' => 'span12')
            );
            
            
           $this->widget(
                'bootstrap.widgets.TbRedactorJs', [
            'model' => $model,
            'attribute' => 'contenido',
            'editorOptions' => [
                'iframe' => true,
            ],
            
                ]
        );
          
            $this->widget('bootstrap.widgets.TbButton', array(
                'buttonType' => 'submit',
                'type' => 'primary',
                'label' => 'Enviar'
            ));
            ?>


<?php $this->endWidget(); ?>



        </div>


    </div>
</div>